Texture2D texture_;
matrix Worldmatrix;
matrix Viewmatrix;
matrix Projectionmatrix;

SamplerState samplingMethod
{
    Filter = MIN_MAG_MIP_LINEAR;
    AddressU = Wrap;
    AddressV = Wrap;
};

struct VERTEXSHADER_INPUT
{
    float4 Loc : POSITION;
    float2 Tex : TEXCOORD;
};

struct PIXELSHADER_INPUT
{
    float4 Loc : SV_POSITION;
    float2 Tex : TEXCOORD0;
};

PIXELSHADER_INPUT VSVertexShader(VERTEXSHADER_INPUT coordsInput)
{
    PIXELSHADER_INPUT coordsOutput = (PIXELSHADER_INPUT)0;
    coordsOutput.Loc = mul(coordsInput.Loc, Worldmatrix);
    coordsOutput.Loc = mul(coordsOutput.Loc, Viewmatrix);
    coordsOutput.Loc = mul(coordsOutput.Loc, Projectionmatrix);
    coordsOutput.Tex = coordsInput.Tex;
    
    return coordsOutput;
}

float4 PSPixelShader(PIXELSHADER_INPUT inputcoords) : SV_Target
{
    return texture_.Sample(samplingMethod, inputcoords.Tex);
}

technique10 TextureEffect
{
    pass P0
    {
        SetGeometryShader(NULL);
        SetVertexShader(CompileShader(vs_4_0, VSVertexShader()));
        SetPixelShader(CompileShader(ps_4_0, PSPixelShader()));
    }
}


